names_网新1 = ["Mike","Marry","Jan","Jack"]
names_网新2 = ["Alex","Zhichao","Lihua"]

# 4.删除列表
# names.clear()
# print(names)

# 5.合并列表extend 是有顺序的，（）里面的list
# names_网新2.extend（names_网新1）
# print(names_网新2)

# 6.copy（）复制列表
names_网新1复制 = names_网新1
print(names_网新1)
print(names_网新1复制)
names_网新1.append("youge")
print("names_网新1：",names_网新1)
print("names_网新1复制：",names_网新1复制)

# 引入copy（）

names_网新1_源数据备份 = names_网新1.copy()
print(names_网新1)
print(names_网新1_源数据备份)
names_网新1.append("youge")
print("names_网新1：",names_网新1)
print("names_网新1_copy：",names_网新1_源数据备份)

# 用切片[:] 等价于 copy()方法
names_网新1_源数据备份 = names_网新1[:]
print(names_网新1)
print(names_网新1_源数据备份)
names_网新1.append("youge")
print("names_网新1：",names_网新1)
print("names_网新1_源数据备份：",names_网新1_源数据备份)

stu_id = [95,97,90,90,97,88,90]
# 7.count() 查看元素出现的次数/统计数量
print(stu_id.count(90))

# 8. sort() 排序 reverse=True 从高到低，默认从低到高排序
stu_id.sort(reverse=True)
print(stu_id)

names_网新1.sort() # 字符串排序方法是 ： 首字母a-z顺序
print(names_网新1)

